#include <vector>  
#include <stdio.h>  
#include<opencv2/opencv.hpp>  
#include<opencv2/highgui/highgui.hpp>
#include<opencv2\imgproc\imgproc.hpp>
using namespace cv;

int main()
{
	//创建带alpha通道的Mat  
	//Mat m = imread("E:\\1.png",1);
	//imshow("原图",m);
	//图像腐蚀getStructuringElement()==>Size()内核矩阵大小   erode为图像腐蚀函数
/*	Mat e = getStructuringElement(MORPH_RECT,Size(3,3));
	Mat dst;
	erode(m,dst,e);
	imshow("腐蚀处理后", dst);
*/
	//图像均值铝箔
	/*
	Mat d2; 
	blur(m, d2, Size(1, 1));
	imshow("均值铝箔",d2);
	waitKey(0);
	*/
	/*
	Mat d3, d4, d5;
	d3.create(m.size(),m.type());
	cvtColor(m,d5,COLOR_RGB2GRAY);
	blur(d5,d4,Size(3,3));
	Canny(d4,d3,3,9,3);
	imshow("canny边缘提取",d3);
	*/
	/*
	VideoCapture vc("E:\\BaiDuYunDownload\\opencv\\opencv\\Opencv_结构—wmv.wmv");
	while (1){
		Mat f;
		vc >> f;
		imshow("视屏",f);
		waitKey(30);
	}
	*/
	VideoCapture vc0(0);
	while (1){
		Mat s,s1,s2,s3;
		vc0 >> s;
		s1.create(s.size(),s.type());
		cvtColor(s, s3, COLOR_RGB2GRAY);
		blur(s3, s2, Size(3, 3));
		Canny(s2,s1,0,30,3);
		imshow("摄像头", s1);
		waitKey(30);
	}
	//waitKey(0);
	return 0;
}